<template>
  <div id="app">
    <transition name="slide-left">
      <keep-alive  include="mall">
        <router-view class="child-view"></router-view>
      </keep-alive>
    </transition>
    <!-- <my-footer v-show="needShowFooter"></my-footer> -->
  </div>
</template>

<script>
//import myFooter from "@/components/footer.vue";

//这里做的一切都是为了消息推送
export default {
  name: "App",
  data() {
    return {
    };
  },
  // provide(){
  //   return{
  //     reload:this.reload
  //   }
  // },
  // components:{
  //   "my-footer": myFooter    
  // },
  computed: {
    needShowFooter(){
      return this.$store.state.needShowFooter;      
    }
  },
  mounted() {

  },
  watch: {
    '$route' (to, from) {
      if(to.name == "home"||to.name == "tradIndex"||to.name == "assetIndex"||to.name == "my"||to.name =="circulate"||to.name == "Registration"||
        to.name == "Activatepoints"||to.name == "Bonus"||to.name == "FormAsset"
      ){
        this.$store.commit("updateNeedShowFooter", true);
      }else{
        setTimeout(()=>{
          this.$store.commit("updateNeedShowFooter", false);       
        },10)
      }
    }
  },
  // 删除了relaod方法
  methods: {
    // reload(){
    //   this.isRouterAlive = false;
    //   console.log(321)
    //   this.$nextTick(function(){
    //     this.isRouterAlive =true
    //     console.log(123)
    //   })
    // }
  }
};
</script>

<style>
.child-view {  
  position: absolute;  
  left: 0;  
  top: 0;  
  width: 100%;   
  height: 100%;
  overflow-y: scroll;
  transition: all .5s cubic-bezier(.55,0,.1,1); 
}  
.slide-left-enter, .slide-right-leave-active {  
  opacity: 0;  
  -webkit-transform: translate(30px, 0);  
  transform: translate(30px, 0);  
}  
.slide-left-leave-active, .slide-right-enter {  
  opacity: 0;  
  -webkit-transform: translate(-30px, 0);  
  transform: translate(-30px, 0);  
}
</style>
